package com.bestv.search.spider.youku.dao.hibernate;

import com.bestv.search.spider.dao.hibernate.GenericDaoHibernate;
import com.bestv.search.spider.youku.dao.YouKuVideoDetailInfoDao;
import com.bestv.search.spider.youku.model.YouKuVideoDetailInfo;

import java.util.Date;
import java.util.List;

public class YouKuVideoDetailInfoDaoHibernate extends GenericDaoHibernate<YouKuVideoDetailInfo, Long> implements
        YouKuVideoDetailInfoDao {

    public YouKuVideoDetailInfoDaoHibernate() {
        super(YouKuVideoDetailInfo.class);
    }

    @SuppressWarnings("unchecked")
    @Override
    public List<YouKuVideoDetailInfo> getInfoForHotComments(Date date) {
        String hql = "from YouKuVideoDetailInfo where hotcommentsSyncTime<?";
        return getHibernateTemplate().find(hql, new Object[]{date});
    }
}
